<template>
  <div class="activityList">
    <div
      class="item"
      v-for="(item, i) in list"
      :key="i"
      @click="toDetail(item)"
    >
      <div>体检预约{{ item.ssjhmc }}</div>
      <div>
        <span>所属年度：{{ item.year }}</span>
        <span class="right">
          <span :class="item.isBm == 0 ? 'red' : 'green'">{{ item.isBm == 0 ? "未报名" : "已报名" }}</span>
          <van-icon name="arrow" />
        </span>
      </div>
      <div>体检预约时间：{{ `${item.tjkssj||'2019/06/08'}—${item.tjjssj||'2019/06/08'}` }}</div>
    </div>
  </div>
</template>

<script>
import {tjryQuertjjhlist} from '../assets/js/api';
export default {
  data() {
    return {
      list: [],
      dspToken: localStorage.dspToken
    };
  },
  mounted() {
    tjryQuertjjhlist({
      dspToken: this.dspToken
    }).then(res => {
      if (res.code.status === '1') {
        this.list = res.data;
      } else {
        this.$toast('获取数据失败');
      }
    });
  },
  methods: {
    toDetail(v) {
      this.$router.push({
        path: '/healthCheckUpSign',
        query: {
          id: v.tjjhId
        }
      });
    }
  }
};
</script>

<style lang="less" scoped>
.activityList {
  .item {
    width: 704px;
    height: 195px;
    background-color: #ffffff;
    box-shadow: 3px 4px 9px 1px rgba(1, 88, 155, 0.05);
    border-radius: 8px;
    margin: 0 auto;
    margin-top: 23px;
    position: relative;
    padding: 31px 30px 26px 33px;
    box-sizing: border-box;
    &::before {
      content: "";
      width: 5px;
      height: 195px;
      background-color: #3198ed;
      position: absolute;
      left: 0;
      top: 0;
      border-top-left-radius: 50px;
      border-bottom-left-radius: 50px;
    }
    > div:first-child {
      font-size: 34px;
      color: #333333;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }
    > div:nth-child(2) {
      font-size: 30px;
      color: #888888;
      margin-top: 29px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 30px;
    }
    > div:last-child {
      font-size: 30px;
      color: #888888;
      margin-top: 4px;
    }
    .red {
      color: #d42a2b;
      font-size: 36px;
      margin-right: 10px;
    }
    .green {
      color: green;
      font-size: 36px;
      margin-right: 10px;
    }
  }
}
</style>
